﻿using System;
using System.Collections.Generic;
using Net5ApiAndEfMySql.DtoModel;
using Net5ApiAndEfMySql.DtoModel.SystemAdmin;
using Net5ApiAndEfMySql.PoModel.SystemAdmin;
using VueAndNetCoreEfApi.PoModel.SystemAdmin;

namespace Net5ApiAndEfMySql.IService.SystemAdmin
{
    public interface IOperatorService : IBaseService
    {

        #region 系统
        OperatorPo GetAdminUserByUserName(string userName);

        OperatorDto Login(string userName, string pwd, ClientType clientType, out string mess);


        OperatorDto IniUserAndToken(OperatorPo adminUserPo, ClientType clientType);

        ResultCode ValidateToken(string token);


        OperatorDto GetUserInRedisByToken(string token);

        SimpleTokenInfo DecodeToken(string token);

        OperatorDto GetLoginUserByToken(string token);

        bool LoginOut(string token);
        bool ValidateUserName(string userName);

        OperatorDto GetAdminUserDtoByUserName(string userName);
        #endregion


        //操作员显示
        public PagerResult<OperatorDto> GetPageList(SearchModel m);
        //操作员添加
        public bool AddOperator(OperatorDto obj);
        //操作员修改
        public bool UptOperator(OperatorDto obj);
        //操作员状态修改
        public bool UptStateByCard(string card);
        //操作员删除
        public bool DelOperator(string card);
        //操作员批量删除
        public bool DelOperatorList(string keys);
        //操作员获取
        public OperatorPo GetOperatorByCard(string card);
        //唯一验证
        public bool ValidateOperatorByAccount(string account);
        public bool ValidateOperatorByCard(string card);

        //获取角色
        public List<RoleDbPo> GetRoles();
        //获取员工
        public List<EmployeePo> GetEmployees();
    }
}
